<%- title t('users.sign_in_title', site_name: site_name) %>
<%- description 'Sign in page for Greasy Fork accounts.' %>

<p><%=t('users.sign_in_description', site_name: site_name)%></p>

<h3><%=t('users.sign_in_external')%></h3>

<div>
	<% if Rails.application.config.available_auths.empty? %>
		<p>(No external providers configured.)</p>
	<% else %>
		<%=form_tag(external_login_path, {:method => :get, :class => 'inline-form external-login-form'}) do %>
			<div>
				<% Rails.application.config.available_auths.keys.reverse.each do |provider| %>
					<span class="external-login-container">
						<button name="provider" class="external-login <%=provider%>-login" value="<%=provider%>">
							<%=t('users.sign_in_with', provider: Identity.pretty_provider(provider)) %>
						</button>
					</span>
				<% end %>
			</div>

			<% if devise_mapping.rememberable? -%>
				<div><%= check_box_tag :remember_me %><%= label_tag :remember_me, t('activerecord.attributes.user.remember_me') %></div>
			<% end -%>
		<% end %>
	<% end %>
</div>

<h3><%=t('users.sign_in_password')%></h3>

<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
  <div><%= f.label :email %><br />
  <%= f.email_field :email %></div>

  <div><%= f.label :password %><br />
  <%= f.password_field :password %></div>

  <% if devise_mapping.rememberable? -%>
    <div><%= f.check_box :remember_me %><%= f.label :remember_me %></div>
  <% end -%>

  <div><%= f.submit t('.sign_in', :default => "Sign in") %></div>
<% end %>

<%= render "devise/shared/links" %>
